package com.blocks.mq.producer.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
/*
* 实体类，对应数据库的表
* */

/**
 * @author lxd
 * @date 2020/12/2 20:39
 */
@AllArgsConstructor
@NoArgsConstructor
@ToString
@EqualsAndHashCode
@Data
@Entity(name="tb_stu_info")//持久化的包,表明当前是实体类，当前的实体类和tb_stu_info关系表进行映射
@Table(name="tb_stu_info")
public class Student {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    //以下都是普通的列
    @Column
    private String name;
    @Column
    private String stuNo;
    @Column
    private String gender;
}
